; water bump pixel shader used by A3DTerrainWater. 

; t0, first layer bump map
; t1, reflection map

ps.1.1

def c1, 0.0, 1.0, 0.0, 0.6
def c2, 0.0, 0.0, 0.0, 0.9

tex t0
;tex t1
;tex t2
texbem t1, t0
texbem t2, t0
texcoord t3

; dot eye-vector with per-pixel normal from t1
dp3_sat	r1.rgba, t3, t1_bx2
mul r0.rgb, t2, v0
+mul r0.a, r1.a, r1.a
; specular map
dp3_sat r1.rgb, c0, t3

; below is the hard specular mode
mul r1, r1, r1
mad_sat r1, r1, t2_bx2, r1_bias
mul r1, r1, r1

; this is the soft specular mode
;mul r1, r1, t2_bx2
;mul r1, r1, r1

mad r0.rgb, r1, t1.a, r0
+lrp r0.a, r0.a, c2.a, c1.a
